package club.banyuan.demo.sec.dao;

import club.banyuan.demo.sec.model.Permission;
import club.banyuan.demo.sec.model.Role;
import club.banyuan.demo.sec.model.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AuthDao {

    /**
     * 根据用户名查找用户
     */
    User findUserByUsername(@Param("username") String username);

    /**
     * 根据用户ID查找所有角色
     */
    List<Role> findRolesByUserId(@Param("userId") Integer userId);

    /**
     * 根据角色IDs 查找所有的权限
     */
    List<Permission> findPermissionsByRoleIds(@Param("roleIds") List<Integer> roleIds);
}
